package cn.com.dwr.modules.app.controller;

import cn.com.dwr.common.lang.Result;
import cn.com.dwr.modules.app.annotation.Login;
import cn.com.dwr.service.AppUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/app")
public class UserController {

    @Resource
    AppUserService appUserService;

    /**
     * 用户信息
     * @return
     */
    @Login
    @GetMapping("/userInfo")
    public Result getUserInfo(){
        return Result.success(appUserService.getCurrentUser());
    }

}
